home *** CD-ROM | disk | FTP | other *** search
/ QRZ! Ham Radio 8 / QRZ Ham Radio Callsign Database - Volume 8.iso / mac / files / t_sys5 / unixcpio.gz / unixnet.cpio / telnet.h < prev    next >
C/C++ Source or Header  |  1994-07-11  |  1KB  |  45 lines

  1. #define    LINESIZE    256    /* Length of local editing buffer */
  2.  
  3.  
  4. /* Telnet command characters */
  5. #define    IAC        255    /* Interpret as command */
  6. #define    WILL        251
  7. #define    WONT        252
  8. #define    DO        253
  9. #define    DONT        254
  10.  
  11. /* Telnet options */
  12. #define    TN_TRANSMIT_BINARY    0
  13. #define    TN_ECHO            1
  14. #define    TN_SUPPRESS_GA        3
  15. #define    TN_STATUS        5
  16. #define    TN_TIMING_MARK        6
  17. #define    NOPTIONS        6
  18.  
  19. /* Telnet protocol control block */
  20. struct telnet {
  21.     struct tcb *tcb;
  22.     char state;
  23.  
  24. #define    TS_DATA    0    /* Normal data state */
  25. #define    TS_IAC    1    /* Received IAC */
  26. #define    TS_WILL    2    /* Received IAC-WILL */
  27. #define    TS_WONT    3    /* Received IAC-WONT */
  28. #define    TS_DO    4    /* Received IAC-DO */
  29. #define    TS_DONT    5    /* Received IAC-DONT */
  30.  
  31.     char local[NOPTIONS];    /* Local option settings */
  32.     char remote[NOPTIONS];    /* Remote option settings */
  33. #ifdef    UNIX
  34.     struct    mbuf    *inbuf;        /* ptr to buffer holding excess rcvd chars */
  35.     struct    mbuf    *outbuf;    /* ptr to buffer holding excess to-send chars */
  36.     int    fd;            /* file descriptor of pty */
  37. #endif
  38.  
  39.     struct session *session;    /* Pointer to session structure */
  40. };
  41. #define    NULLTN    (struct telnet *)0
  42. extern int refuse_echo;
  43. struct telnet *open_telnet();
  44. int send_tel(),tel_input();
  45.